/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package main.NER;

import java.io.Serializable;
import java.util.Set;
import main.KBProcess.Fragment;

/**
 * <p>
 * <code>Fruit</code> defines the different attributes of its parent/branch
 * </p>
 * @author Isaac Osesina
 */
public interface Fruit extends Cloneable, Serializable  {

    /**
     * <P>Add the count of fragments belonging to this fruit</P>
     * @param count
     */    
    void incrementMyType(Integer count);

    /**
     * <P>Returns the count of fragments contributing to this branch</P>
     * @return
     */
    int getMyTypeFreq();

    

    /**
     * <P>Add id of other fragments sharing  fruit</P>
     * @param idx
     */
    Set<Object> addCousinType(Object o);


    /**\
     * <P>Returns a set of all fragment ids sharing  fruit</P>
     * @return
     */
    Set<Object> getCousinTypeList();

    /**
     * <P>Returns count of fragments sharing fruit</P>
     * @return
     */
    int getTotalFreq();

    /**
     * <P>Returns the count of key parameters not associated to any
     * entity type within KB</P>
     * @return
     */
    int getNonCousinTypeCount();

    /**
     * <P> Returns ambiguity of fruit
     * Ambiguity is determined by the number of entity types associated with
     * fruit</P>
     * @return
     */
    boolean isAmbiguous();

    /**
     *<P>Indicates if fruit resulted from regular key parameter or from appended
     * key parameter (used to eliminate ambiguity</P>
     * @return
     */
    boolean isAppend();

    /**
     *<P>Indicates whether fruit is prunable
     * It is prunable if its branch or elder of its branch is appended </P>
     * @return
     */
    boolean isPrunable();

    /**
     *<P> Indicates whether its branch is the end of a context
     * </P>
     * @return
     */
    boolean isTerminator();

    /**
     * <P> Indicates whether the context (till this character) was appended with extra information in
     * the attempt to make it unambiguous</P>
     * @param append
     */
    void setAppend(boolean append);

    void setCousinTypeList(Set<Object> CousinTypeList);

    /**
     * <P> Indicates whether the context (till this character) is the end of a
     * natural context</P>
     * @param terminator
     */
    void setTerminator(boolean terminator);

    /**
     * <P> Occurrence of the context where it is not associated with any entity type </P>
     * @param nonCousinTypeCount
     * @return
     */
    int setNonCousinTypeCount(int nonCousinTypeCount);

    Set<Fragment> addTerminatingFragment(Fragment fragment);

    Set<Fragment> getTerminatingFragmentList();

    int getTerminatingFragmentCount();

    void setTerminatingFragmentList(Set<Fragment> terminatingFragmentIDList);

    Fragment setFragmentSample(Fragment fragment);

    Fragment getFragmentSample();

    double getMyTypeProportion();

        /**
     * <p>
     * <code>clone</code> will return a deep clone or if this node is
     * read-only then clone will return the same instance.
     * </p>
     *
     * @return a deep clone of myself or myself if I am read only.
     */
    Object clone();

}
